<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
    $("#<?php echo $id;?>").DataSource({url:'useranalyse/get_analysis_cash',
        fields:[

//                {field:'username', title:'会员账号', align:'center',width:300,sortable:true},
//                {field:'money', title:'总金额', align:'center',width:300,sortable:true},
//                {field:'discount_amount',title:'优惠金额', align:'center', width:300, sortable:false},
//                {field:'valid_num',title:'有效人数', align:'center',width:300, sortable:true}


            [
                {field:'username',title:'名称',rowspan:2,align:'center',width:100,sortable:true},
                {title:'公司入款',colspan:3},
                {title:'线上入款',colspan:3},
                {title:'人工入款',colspan:3},
                {title:'优惠卡充值',colspan:2},
                {title:'人工出款',colspan:2},
                {title:'线上出款',colspan:2}
            ],
            [
                {field:'company_in_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'company_in_discount_money',title:'优惠金额',width:85,align:'center',sortable:true},
                {field:'company_in_num',title:'笔数',width:85,align:'center'},

                {field:'online_in_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'online_in_discount_money',title:'优惠金额',width:85,align:'center',sortable:true},
                {field:'online_in_num',title:'笔数',width:85,align:'center'},

                {field:'manual_in_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'manual_in_discount_money',title:'优惠金额',width:85,align:'center',sortable:true},
                {field:'manual_in_num',title:'笔数',width:85,align:'center'},

                {field:'coupon_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'coupon_num',title:'笔数',width:85,align:'center'},

                {field:'manual_out_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'manual_out_num',title:'笔数',width:85,align:'center'},

                {field:'online_out_total_money',title:'总金额',width:85,align:'center',sortable:true},
                {field:'online_out_num',title:'笔数',width:85,align:'center'}
            ]


        ], tools:[
            {instant:false},
            {type:'combobox',text:'类型',width:100,name:'sort',value:'', items:'<option value="1">公司入款</option><option value="2">人工入款</option>'},
            {type:'textbox', text:'会员账号', width:100,name:'username'},
            {type:'datebox', text:'日期', width:100,name:'sdate'},
            {type:'datebox', text:'-', width:100,name:'edate'},
            {type:'combobox',text:'排序',width:100,name:'sort',value:'', items:'<option value="1">总金额</option><option value="2">总笔数</option>'},
            {text:"搜索", iconCls:"icon-search", handler:function(){
                $('#<?php echo $id?>').DataSource('search');
            }},
            '-'
        ],
        checkbox:false,
        edit:true,
        footer:true,
        success:function(){

        }
    });
</script>